Skip to content

Follow Here's My Church's claimed listings and automatic checks - #13

Merged
heyderekj merged 1 commit into
mainfrom
codex/lookup-claims-review
Nov 13, 2026
Merged

heyderekj merged 1 commit into
mainfrom
codex/lookup-claims-review

Conversation

@heyderekj

Copy link
Copy Markdown
Contributor

What changed

Here's My Church is adding two things (harvouscom/heresmychurch#56 and #58): a church that has claimed its listing reviews everyone else's changes first, and held changes are checked automatically (deterministic checks, the church's own website with a Workers AI-located quote that code verifies, a 72-hour quiet period for low-risk fields), with a human reviewer for what can't be decided. This PR makes Lookup understand both.

Worker

  • statusFrom reads an optional reviewBy from HMC's JSON; contribution results carry reviewBy: "church" when present. Statuses are unchanged (live, in_review, …), and the 503/maintenance handling is untouched: a 503 is still try_again, never rejected.
  • New claimed column (worker/schema.sql, worker/migrations-m4.sql), carried from the export through project/sync/writeChurch and returned on the record as claimed: boolean. Only a claimed row hashes the flag, so unclaimed rows keep their doc_hash and the next sync doesn't rewrite every row.
  • CONTRIBUTABLE_FIELDS keeps review for compatibility and adds checks: "automatic" (service times, denomination, languages, ministries, phone), "automatic-then-reviewer" (name, website, address, email, pastor name, closed/duplicate reports) and "reviewer" (moves). /v1/meta shows it. The doc comment now describes the real rules.
  • The lookup-demo sandbox answers in_review + reviewBy: "church" on a claimed listing.

SDK, widget and shadcn registry

  • Badges before sending: a blank field says "Goes live", a replacement (and email/pastor name, which Lookup always holds) says "Checked automatically", and any change on a claimed listing says "The church reviews this". After sending, a held-for-church result says "Sent to the church".
  • New strings checked, churchReviews, sentToChurch in English, es, fr, de, pt and pl. reviewed stays in Strings (no longer shown) so existing overrides still type-check.
  • New core helpers consentBadge and resultText, shared by <church-lookup> and ChurchConsent. Optional types: ChurchRecord.claimed, reviewBy on results, checks on meta. Registry lib and shadcn demo copies regenerated. CHANGELOG has an Unreleased entry. Core is 5.3 KB gzipped (budget 5.5).

Docs

  • docs/data.md: the review table is rewritten (it said service times etc. went live on one vote).
  • docs/api.md: claimed on the record, checks on meta, and reviewBy in the statuses section.
  • docs/index.md and docs/how-search-works.md: church-owner review first, automated checks where AI only locates a quote on the church's website and code verifies it, and a person for what the checks can't decide. Ranking is still described as a formula, not AI.

Compatibility

Backward compatible with the HMC that's live today: every new field is optional and additive. Without claimed in the export, every record says claimed: false; without reviewBy, results are exactly as before. The new behaviour depends on harvouscom/heresmychurch#56 and #58 shipping. Until then, the "Checked automatically" badge describes a replacement more cautiously than today's HMC treats phone and service times.

Before deploy

  • Apply worker/migrations-m4.sql to the production D1 before deploying this Worker, because sync writes the claimed column.
  • Nothing deployed and nothing published to npm.

Tests

  • pnpm test: registry check, worker 217 passed, SDK 191 passed.
  • pnpm typecheck: clean.
  • New tests: reviewBy passthrough, 503 still try_again, sandbox on a claimed listing, claimed through sync/writeChurch/toRecord, hash stability, meta checks, badge and result wording.

🤖 Generated with Claude Code

Here's My Church now lets a church that has claimed its listing review
others' changes first, and checks held changes automatically before a
person sees them. Lookup handles both, and still works with today's HMC:

- Contributions pass through reviewBy: "church" from HMC's answer. The
  statuses are unchanged, and a maintenance 503 is still try_again.
- Sync carries claimed from the export into a new D1 column (migration
  m4) and the record returns claimed: true/false. Only a claimed row
  hashes the flag, so existing rows don't all rewrite.
- /v1/meta adds checks to each contributable field; review is kept.
- The widget and the shadcn ChurchConsent badge a blank field "Goes
  live", a replacement "Checked automatically", a claimed listing "The
  church reviews this", and a held-for-church result "Sent to the
  church", in all six languages.
- Docs describe the real rules, and that AI only locates a quote on the
  church's website that code then verifies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@heyderekj
heyderekj merged commit db83a27 into main Nov 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant